home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / kn.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  1.7 KB  |  72 lines

  1. /**/
  2.  
  3. call rxmuiopt("debugmode showerr")
  4.  
  5. signal on halt
  6. signal on break_c
  7.  
  8. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  9. if AddLibrary("rxmui.library")~=0 then exit
  10.  
  11. call createApp
  12. call SetNotifies
  13.  
  14. call set("win","open",1)
  15. call getattr("win","open","o")
  16. if o=0 then do
  17.     say "can't open window"
  18.     exit
  19. end
  20.  
  21. call handleApp
  22. exit
  23. /***********************************************************************/
  24. handleApp: procedure
  25. ctrl_c=2**12
  26. s=0
  27. do forever
  28.     call handle("APP","H",s)
  29.     do i=0 to h.num-1
  30.         if h.i="QUIT" then exit
  31.         say h.num-1 h.i
  32.     end
  33.     s=Wait(or(h.signals,ctrl_c))
  34.     if and(s,ctrl_c)>0 then exit
  35. end
  36. exit
  37. /***********************************************************************/
  38. err: procedure expose sigl rxmuierror
  39. parse arg res
  40. say sigl "["res"]"
  41.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  42.     exit
  43. /***********************************************************************/
  44. createApp: procedure
  45.     app.Title="Speedbar"
  46.     app.Version="$VER: Speedbar 1.0 (10.12.99)"
  47.     app.Copyright="©1999, alfie"
  48.     app.Author="alfie"
  49.     app.Description="Speedbar example"
  50.     app.Base="SPEEDBAR"
  51.     app.SubWindow="WIN"
  52.      win.ID="MAIN"
  53.      win.Title="Speedbar Example"
  54.      win.Contents="MGROUP"
  55.       mgroup.0="lv"
  56.         lv.class="knob"
  57.  
  58.     res=NewObj("APPLICATION","APP")
  59.     if res~=0 then call err(res)
  60.  
  61.     return
  62. /***********************************************************************/
  63. setNotifies: procedure
  64.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  65.     if res~=0 then call err(res)
  66.     return
  67. /***********************************************************************/
  68. halt:
  69. break_c:
  70.     exit
  71. /**************************************************************************/
  72.